#pragma once
//#include "Definitions.h"

static void CreateCube(float radius, XMFLOAT3**_positions, XMFLOAT3** _normals,  XMFLOAT2** _tangents, XMFLOAT2** _uvs, UINT** _indices){
#if 0
	UINT numVerts = 36;
	UINT numIndices = 36;

	XMFLOAT3* positions;
	XMFLOAT3* normals;
	XMFLOAT2* tangents;
	XMFLOAT2* uvs;
	UINT* indices;

	positions = new XMFLOAT3[numVerts];
	positions[0] =  XMFLOAT3(-radius,  radius, radius);
	positions[1] =  XMFLOAT3(-radius, -radius, radius);
	positions[2] =  XMFLOAT3( radius, -radius, radius);
	positions[3] =  XMFLOAT3(-radius,  radius, radius);
	positions[4] =  XMFLOAT3( radius, -radius, radius);
	positions[5] =  XMFLOAT3( radius,  radius, radius);
	//Back					  		  
	positions[6] =  XMFLOAT3( radius,  radius, -radius);
	positions[7] =  XMFLOAT3( radius, -radius, -radius);
	positions[8] =  XMFLOAT3(-radius,  radius, -radius);
	positions[9] =  XMFLOAT3(-radius,  radius, -radius);
	positions[10] = XMFLOAT3( radius, -radius, -radius);
	positions[11] = XMFLOAT3(-radius, -radius, -radius);
	//Left				
	positions[12] = XMFLOAT3(-radius, radius, -radius);
	positions[13] = XMFLOAT3(-radius,-radius, -radius);
	positions[14] = XMFLOAT3(-radius,-radius,  radius);
	positions[15] = XMFLOAT3(-radius, radius, -radius);
	positions[16] = XMFLOAT3(-radius,-radius,  radius);
	positions[17] = XMFLOAT3(-radius, radius,  radius);
	//Right					  
	positions[18] = XMFLOAT3(radius, -radius,  radius);
	positions[19] = XMFLOAT3(radius, -radius, -radius);
	positions[20] = XMFLOAT3(radius,  radius, -radius);
	positions[21] = XMFLOAT3(radius, -radius,  radius);
	positions[22] = XMFLOAT3(radius,  radius, -radius);
	positions[23] = XMFLOAT3(radius,  radius,  radius);
	//Top					  
	positions[24] = XMFLOAT3(-radius, radius, -radius);
	positions[25] = XMFLOAT3(-radius, radius,  radius);
	positions[26] = XMFLOAT3( radius, radius,  radius);
	positions[27] = XMFLOAT3(-radius, radius, -radius);
	positions[28] = XMFLOAT3( radius, radius,  radius);
	positions[29] = XMFLOAT3( radius, radius, -radius);
	//Bottom				  
	positions[30] = XMFLOAT3(-radius, -radius,  radius);
	positions[31] = XMFLOAT3(-radius, -radius, -radius);
	positions[32] = XMFLOAT3( radius, -radius, -radius);
	positions[33] = XMFLOAT3(-radius, -radius,  radius);
	positions[34] = XMFLOAT3( radius, -radius, -radius);
	positions[35] = XMFLOAT3( radius, -radius,  radius);

	*_positions = positions;
#endif
}

static void CreatePlane(float radius, XMFLOAT3** _vertices, XMFLOAT3** _normals, XMFLOAT2** _uvs, XMFLOAT2** _tangents, UINT** _indices){
	/*

	Z
	|__X    O - origin

	(-r,r)		 ___________________   (r,r)
	t(0,0)		|					| t(1,0)	|
	n(0,1,0)	|					| n(0,1,0)	| r
	|		  O			|			|
	|					|
	|___________________|
	(-r,-r)					     (r,-r)
	t(0,1)						  t(1,1)
	n(0,1,0)					  n(0,1,0)


	----------
	r
	*/
	//XMFLOAT3 positions[] = {
	//	//Triangle1
	//	XMFLOAT3(-radius, 0, radius),
	//	XMFLOAT3(-radius, 0, -radius),
	//	XMFLOAT3(-radius, 0, -radius),
	//	//Triangle2
	//	XMFLOAT3(-radius, 0, radius),
	//	XMFLOAT3(radius, 0, -radius),
	//	XMFLOAT3(radius, 0, radius)
	//};

	XMFLOAT3* positions = new XMFLOAT3[4];

	positions[0] = XMFLOAT3(-radius, 0, radius);
	positions[1] = XMFLOAT3(-radius, 0, -radius);
	positions[2] = XMFLOAT3(radius, 0, -radius);
	positions[3] = XMFLOAT3(radius, 0, radius);

	*_vertices = positions;

	XMFLOAT3 xzNormal = XMFLOAT3( 0, 1, 0 );
	XMFLOAT3* normals = new XMFLOAT3[4];
	normals[0] = xzNormal;
	normals[1] = xzNormal;
	normals[2] = xzNormal;
	normals[3] = xzNormal;
	*_normals = normals;

	XMFLOAT2* uvs = new XMFLOAT2[4];

	uvs[0] = XMFLOAT2(0, 0);
	uvs[1] = XMFLOAT2(0, 1);
	uvs[2] = XMFLOAT2(1, 1);
	uvs[3] = XMFLOAT2(1, 0);

	*_uvs = uvs;

	XMFLOAT2 texVec = XMFLOAT2( 1, 0 );
	XMFLOAT2* tangents = new XMFLOAT2[4];

	tangents[0] = texVec;
	tangents[1] = texVec;
	tangents[2] = texVec;
	tangents[3] = texVec;
	*_tangents = tangents;

	UINT* indices = new UINT[6];
	indices[0] = 0;
	indices[1] = 3;
	indices[2] = 2;
	indices[3] = 0;
	indices[4] = 2;
	indices[5] = 1;

	*_indices = indices;
}

//static void CreateCube(float radius, float* _positions,...); //Use this to CHOOSE what attributes are needed

